package com.haste.system.controller;

import com.haste.common.domain.po.BaseUserConfigPo;
import com.haste.common.domain.vo.ResponseVo;
import com.haste.common.service.IBaseUserConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author haste
 */
@RestController
@RequestMapping("/user/config")
public class UserConfigController {
    @Resource
    private IBaseUserConfigService userConfigService;
    @GetMapping("")
    @ApiOperation(value = "获取用户配置")
    public ResponseVo<BaseUserConfigPo> getUserConfigById(){
        String userId = "2";
        return new ResponseVo<>(userConfigService.getById(userId));
    }

    @PutMapping("/update")
    @ApiOperation(value = "修改用户配置")
    public ResponseVo update(@RequestBody BaseUserConfigPo userConfigPo){
        return new ResponseVo<>(userConfigService.updateById(userConfigPo));
    }
}
